<!DOCTYPE html>
<html lang="utf-8">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>易备安数据管理平台</title>

    <!-- Bootstrap -->
    <link href="/web/css/bootstrap/bootstrap.min.css" rel="stylesheet">
    <link href="/web/css/bootstrap/bootstrap-theme.min.css" rel="stylesheet">

    <link href="/web/css/jquery.datetimepicker.css" rel="stylesheet" type="text/css"/>
    <link href="/web/css/jquery-ui.css" rel="stylesheet" type="text/css"/>
    <link href="/web/css/jquery-ui.theme.css" rel="stylesheet" type="text/css"/>
    <link href="/web/js/jstree/themes/default/style.min.css" rel="stylesheet">

    <link href="/web/js/zTree_v3/css/demo.css" rel="stylesheet" />
    <link href="/web/js/zTree_v3/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
    
    <link rel="stylesheet" type="text/css" href="/web/css/basic.css">
    <link rel="stylesheet" type="text/css" href="/web/css/g.css">
    <link rel="stylesheet" type="text/css" href="/web/css/global.css">
    <link rel="stylesheet" href="/web/css/ui.css">
    <link rel="stylesheet" type="text/css" href="/web/css/client-common.css">
    <link rel="stylesheet" type="text/css" href="css/filelist.css">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
    	.db-config{
    		display:none;
    	}	
    	ul,li{
    		list-style: none;
    	}
    </style>
</head>
<body>
<input type="hidden" id="h_which_path" value="">
<div class="container">
    <div class="container">
        <form id="dsForm" class="form-horizontal">           
        	<div class="index-w100 g-mt15 ">
            	<h3 class="index-title">基本信息</h3>
            	<div class="inner-body">
                	<div class="form-group">
	                     <label for="dsName" class="col-sm-2 control-label">数据源名称：</label>
	                     <div class="col-sm-5">
	                         <input type="text" class="form-control" id="dsName">
	                     </div>
	                     <label for="dsType" class="col-sm-2 control-label">数据源类型：</label>
	                     <div class="col-sm-2">
	                         <select class="form-control" id="dsType">
	                             <option value="0">文件夹</option>
	                             <option value="1">数据库</option>
	                         </select>
	                     </div>
	                 </div>
	                 <div class="form-group ds-path">
	                     <label for="dsPath" class="col-sm-2 control-label">数据源路径：</label>
	                     <div class="col-sm-6">
	                         <input type="text" readonly class="form-control" id="dsPath">
	                     </div>
	                     <div class="col-sm-3">
	                         <a type="button" class="g-cgreen" style="width: 100%;"
	                            href="#" onclick="selectDsPath('','dsPath')" data-toggle="modal">选择路径</a>
	                     </div>
	                 </div>
	                 <div class="form-group db-config">
	                  <label for="dbUsername" class="col-sm-2 control-label">数据库登入名：</label>
	                     <div class="col-sm-3">
	                         <input type="text" class="form-control" id="dbUsername">
	                     </div>
	                     <label for="dbPassword" class="col-sm-2 control-label">登入密码：</label>
	                     <div class="col-sm-3">
	                         <input type="text" class="form-control" id="dbPassword">
	                     </div>
	                 </div>
	                 <div class="form-group db-config">
	                 	<label for="dbType" class="col-sm-2 control-label">数据库类型：</label>
	                     <div class="col-sm-3">
	                         <select class="form-control" id="dbType">
	                             <option value="0">MySql</option>
	                         </select>
	                     </div>
	                     <label for="dbName" class="col-sm-2 control-label">数据库名称：</label>
	                     <div class="col-sm-3">
	                         <input type="text" class="form-control" id="dbName">
	                     </div>
	                 </div>
	                 <div class="form-group db-config">
	                 	<label for="dbHost" class="col-sm-2 control-label">数据库ip地址：</label>
	                     <div class="col-sm-3">
	                         <input type="text" class="form-control" id="dbHost">
	                     </div>
	                     <label for="dbPort" class="col-sm-2 control-label">数据库端口号：</label>
	                     <div class="col-sm-3">
	                         <input type="text" class="form-control" id="dbPort">
	                     </div>
	                 </div>
	                 <div class="form-group" style="display:none">
	                     <label for="description" class="col-sm-2 control-label">数据源描述：</label>
	
	                     <div class="col-sm-10">
	                         <input type="text" class="form-control" id="description">
	                     </div>
	                 </div>
	                 <div class="form-group clearfix">
	                     <label for="dsNeedKey" class="col-sm-2 control-label">操作需要key：</label>
	                     <div class="col-sm-1 g-mt5" >
	                         <input type="checkbox" class="j-checkbox" class="form-control" id="dsNeedKey">
	                     </div>
	                     <label for="dsNeedCode" class="col-sm-3 control-label">操作需要动态验证码：</label>
	                     <div class="col-sm-1 g-mt5" >
	                         <input type="checkbox" class="j-checkbox" class="form-control" id="dsNeedCode">
	                     </div>
	                     <label for="isEncrypt" class="col-sm-2 control-label">是否加密：</label>
	                     <div class="col-sm-1 g-mt5" >
	                         <input checked="checked" type="checkbox" class="j-checkbox" class="form-control" id="isEncrypt">
	                     </div>
	                 </div>
	                 <div class="form-group clearfix">
	                     <label for="isOpenLocalBackup" class="col-sm-2 control-label">开启本地备份：</label>
	                     <div class="col-sm-1 g-mt5" >
	                         <input type="checkbox" class="j-checkbox" class="form-control" id="isOpenLocalBackup">
	                     </div>
	                 </div>
             	</div>
        	</div>
             
           <div class="index-w100 g-mt15 ">
           		<h3 class="index-title">备份策略</h3>
            	<div class="inner-body">
                	<div class="form-group clearfix">                         
                            <label for="startTime" class="col-sm-2 control-label">开始时间：</label>
                            <div class="col-sm-3">
                                <input type="text" readonly class="form-control" id="datetimepicker">
                            </div>
                            <label for="period" class="col-sm-2 control-label">时间间隔：</label>
                            <div class="col-sm-2">
                                <input id="period" name="period" class="form-control" style="width:90%" value="1">
                            </div>
                            <div class="col-sm-2">
                                <select class="form-control" id="unit">
                                    <option value="1">小时</option>
                                    <option value="2">天</option>
                                    <option value="3">周</option>
                                    <option value="4">月</option>
                                </select>
                            </div>
                        
                    </div>
                </div>
            </div>

            <div class="index-w100 g-mt15 g-mb15" style="display:none">
           		<h3 class="index-title">备份高级配置 <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">(展开/收起）</a></h3>
            	                
                <div class="panel-collapse collapse" id="collapseOne">
                <div class="inner-body" >
                    <div class="form-group">
                        <label for="scanType" class="col-sm-2 control-label">扫描模式：</label>
                        <div class="col-sm-10">
                            <select class="form-control" id="scanType">
                                <option value="0">扫描所有文件</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group scan-checkbox">
                        <div class="col-sm-1"></div>
                        <div  class="col-sm-2"><label><input type="checkbox" class="j-checkbox" id="idScanHideFile" name="scanHideFile">扫描隐藏文件</label></div>
                        <div  class="col-sm-2"><label><input type="checkbox" class="j-checkbox" id="idRecordCanNotReadFile" name="recordCanNotReadFile" >记录不可读文件</label></div>
                        <div  class="col-sm-2"><label><input type="checkbox" class="j-checkbox" id="idRecordEmptyDirectory" name="recordEmptyDirectory">记录空文件</label></div>
                        <div  class="col-sm-2"><label><input type="checkbox" class="j-checkbox" id="idRecordEmptyFile" name="recordEmptyFile">记录空目录</label></div>
                        <div  class="col-sm-2"><label><input type="checkbox" class="j-checkbox" id="idVerifyCompleteName" name="verifyCompleteName">进行完整性验证</label></div>
                    </div>
                </div>
                </div>
            </div>

    <div class="control-group g-mt15 g-ar" style="align:center">
    <button id="back" type="button" class="btn btn-lg btn-info g-mr10"
            onclick="window.history.go(-1)">取消
    </button>
    <button id="save" type="button" class="btn btn-lg btn-info g-mr10"
            onclick="saveDataSource();">保存
    </button>
    </div>

    </form>
</div>

</div>


<div class="modal fade" id="test_modal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>

                <h4 class="modal-title">选择数据源路径</h4>
            </div>
            <div class="modal-body">
                <ul id="tree" class="ztree"></ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="setDataSourcePath()">确定</button>
            </div>
        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/web/js/jquery/jquery.min.js"></script>
<script src="/web/js/bootstrap/bootstrap.min.js"></script>
<script src="/web/js/zTree_v3/js/jquery.ztree.core-3.5.js"></script>
<script src="/web/js/jquery_rest.js"></script>
<script src="/web/js/ebeim.js"></script>

<script src="/web/js/jquery/jquery-ui.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/web/js/jquery/jquery.datetimepicker.js"></script>
<script src="/web/js/util.js"></script>
<script src="/web/js/global.js"></script>
<script src="/web/js/jquery/jquery.icheck.min.js"></script>

<script src="js/datasource_add.js"></script>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" style="max-height:500px;overflow-y:auto" 
   aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" 
               data-dismiss="modal" aria-hidden="true">
                  &times;
            </button>
            <h4 class="modal-title" id="myModalLabel">
            请输入动态验证码
            </h4>
         </div>
         <div class="modal-body" id="modal-body" style="text-align: center;">
            <input style="margin-right:15px;" class="input input-large" type="text" id="dynamicCode"/>
            <button id="sendCodeBtn" onclick="send()" class="btn btn-success">获取验证码</button>
         </div>
         <div class="modal-footer">
            <!-- <button type="button" class="btn btn-default" 
               data-dismiss="modal">关闭
            </button> -->
            <button id="submit" onclick="setDynamicCode()" oprt="" type="button" class="btn btn-primary">
              确定
            </button>
         </div>
      </div><!-- /.modal-content -->
</div>
</div>

<div class="window" id="dsWindow">
	<div class="w-head">
		<table width="90%" height="40px" align="center">
			<tr>
				<td width="20%" >数据源根目录<input type="hidden" id="h_ds_path" /></td>
				<td id="ab-ds-dir" width="60%" style="background:#fff;" ></td>
				<td width="20%" style="text-align:center"><button class="btn btn-default" onclick="selectDsParentPath()">返回上一级</button></td>
			</tr>
		</table>
	</div>
	<div class="w-dir-list">
		<ul>
		</ul>
	</div>
	<div class="w-dir-confirm">
		<button class="btn btn-success" onclick="confirmDsDir()">确定</button>
		<button class="btn btn-default" onclick="cancelDsDir()">取消</button>
	</div>
</div>

<div class="shadowDiv" id="tips_shadowDiv" style="z-index: 1999;"></div>
<div class="dialogDiv" id="tips" style="z-index: 2000;">
	<div class="dialogTipDiv">提示<span class="dialogTipContentSpan">信息</span></div>
	<div class="dialogContentDiv" style="text-align: center;">
	</div>
</div>
</body>
</html>